﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class Bank
{
    private string name;
    public string Name { get => name; set => name = value; }

    // 保存账号（简单起见，此处使用数组，可根据需要改成集合）
    private Account[] accounts = new Account[100];
    private int accountCount = 0;

    // 添加账号
    public void AddAccount(Account acc)
    {
        accounts[accountCount++] = acc;
    }

    // 索引器：通过索引获取账号
    public Account this[int index] => accounts[index];

    // 显示银行内所有账号信息
    public void DisplayAccounts()
    {
        for (int i = 0; i < accountCount; i++)
        {
            Console.WriteLine(accounts[i]);
        }
    }
}
